<?php

namespace App\Models;

use Dcat\Admin\Traits\HasDateTimeFormatter;

use Illuminate\Database\Eloquent\Model;

class InviteReward extends Model
{
	use HasDateTimeFormatter;
    protected $table = 'invite_reward';
    protected $guarded = ['id'];

    public function from()
    {
        return $this->hasOne(User::class, 'id', 'from_id')->select(['id', 'name', 'avatar']);
    }

    public function user()
    {
        return $this->hasOne(User::class, 'id', 'uid');
    }



}
